﻿Public Class cMunicipios
    Private lDrMuni As dsGlobal.GLO_MUNICIPIOSRow
    Public Sub New(ByVal idMunicipio As String)
        Try
            Dim daMuni As New dsGlobalTableAdapters.GLO_MUNICIPIOSTableAdapter
            Dim dtMuni As dsGlobal.GLO_MUNICIPIOSDataTable = daMuni.GetDataByIdMunicipio(idMunicipio)
            If dtMuni.Rows.Count > 0 Then
                lDrMuni = dtMuni.Rows(0)
            Else
                Throw New Exception("Municipio no existe verifique e intente de nuevo")
            End If
        Catch ex As Exception
            cError.SalvaError(ex, "Samuel")
            Throw ex
        End Try
    End Sub

    Public ReadOnly Property idMunicipio() As String
        Get
            Return lDrMuni.IDMUNICIPIOS
        End Get
    End Property
    Public ReadOnly Property Municipio() As String
        Get
            Return lDrMuni.MUNICIPIOS
        End Get
    End Property

End Class
